package service.Impl;

import dao.Impl.OrganizationDao;
import entity.Organization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import service.OrganizationService;

import java.util.List;

/**
 * 组织机构数据访问实现类
 */
@Repository
public class OrganizationServiceImpl implements OrganizationService {
     @Autowired
     OrganizationDao organizationDao;

    @Override
    public void create(Organization organization) {
        organizationDao.create(organization);
    }

    @Override
    public Organization findById(Long orgId) {
        return organizationDao.findById(orgId);
    }

    @Override
    public List<Organization> findAll() {
        return organizationDao.findAll();
    }

    @Override
    public void update(Organization organization) {
        organizationDao.update(organization);
    }

    @Override
    public void deleteById(Long orgId) {
       organizationDao.deleteById(orgId);
    }
}
